﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace ExpressionDemo
{
    class Program
    {
        static void Main(string[] args)
        {

            ConstantExpression left = Expression.Constant(123);
            ConstantExpression right = Expression.Constant(456);

            BinaryExpression binaryExpression = Expression.Add(left, right);

            Expression<Func<int>> expression = Expression.Lambda<Func<int>>(binaryExpression, new ParameterExpression[0]);
            Console.WriteLine(expression.Compile().Invoke());
            typeof(int).GetMethod("ToString", new Type[] { });
            

            
        }
    }
}
